When developing a program, the developer attempts to avoid anything that is unnecessary so that the program will be sufficiently fast and the full processing of the task can be completed within the given timeframe.
Occasionally, however, the general conditions change even during the development process and the execution of a program previously delivering adequate performance is compromised.
Runtimes of the functions within a program are typically investigated through the use of what is termed a profiler. Profilers are programming tools which analyze the runtime behavior of software. In software development there are different problem areas that are triggered by inefficient programming. A profiler assists the developer in identifying the problem areas by analyzing and comparing executing programs. From this process measures aimed at the structural and algorithmic improvement of the source code can be derived.
The most frequent application of a profiler is counting and measuring the calls and iterations of functions. This enables the programmer to discover where it is worthwhile optimizing the program. Optimizing functions that are not often used is not especially beneficial to the overall performance of the program and generally makes maintaining the source code more difficult. For this reason the main focus of attention is on functions which are called frequently and take up a lot of time among the total number of calls.
A further aspect is the tracking of memory usage by a program. The profiler is intended to help here in optimizing the use and consumption of working memory and where necessary in identifying errors in the programming due to which memory areas that are no longer being used are not released. Modern profilers provide the possibility of representing concurrent processes graphically in their lifecycle (as a barchart or reference tree, for example). This visualization is intended to help a programmer to interpret the runtime behavior of concurrent processes more effectively and pinpoint errors due to deadlock.